Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract changed to prettify output file #124

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

morrowwm
Copy link

Use python to trim, instead of sox. While the data is in python, reduce noise, filter and normalize, then output sound file.

You might want to reject this, and ask me to add configuration to make this optional, make the highpass cutoff configurable, output both enhanced and raw output files, or other complications. I think at least an enable/disable setting would be desirable. I will need a hint about how to do that nicely.

Use python to trim, reduce noise, filter and normalize, then output sound file.
@alexbelgium
Copy link

alexbelgium commented Jun 27, 2024

Hi, there is already an "accessibility" part in config ; so it could also be looked as part of this ! For example we could have a toggle "clean audio sounds" that if enabled would use this code, if disabled (default) would give the raw sound. A bit like the "shift" feature

EDIT : I can help you with the "adding to settings part", I've done it a couple times and thing I now know where are all the things to take into account (or else you can look at a previous commit including a new config such as the "whitelist" PR already opened) ; you would just need to adapt the python to allow both based on a variable status (true/false)

@morrowwm
Copy link
Author

OK, I will take a look over the next few days. I have some real life interruptions over the next ~100 hours.

I was looking at how this could also be used to "clean" the wav data sent to soundscape. That file is the entire 15 second sound data, which may include multiple detections. Correct?

If so, I should move the noise reduce+filter+normalize processing out to a general purpose function that takes an input file and returns an output file. Any opinion?

@Nachtzuster Nachtzuster marked this pull request as draft June 27, 2024 20:06
@alexbelgium
Copy link

Hi, files cleaning is controversial - some like it some hate it ;-) but indeed I've tried also (=spent hours on) trying to improve detection quality by using the noise-cancel module of pulseaudio, then instead bought a better microphone ;-) I think we should do some trial/errors if we wanted to implement that before anlaysis. I guess the best way would be to apply the filter when the soundscape from pulseaudio or rtsp is cut in the smaller 15-30s wav files for analysis...

@Nachtzuster
Copy link
Owner

It is interesting to have a replacement for sox, but the filtering does not really fit the BirdNET idea of keeping the recorded audio. Well I think so at least.

@morrowwm
Copy link
Author

It is interesting to have a replacement for sox, but the filtering does not really fit the BirdNET idea of keeping the recorded audio. Well I think so at least.

I agree. If this idea does get incorporated, it needs to be an option. Many people have a good recording hardware setup, and have no need to do anything to the sound files.

the noisereduce module fails on stereo input
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants